package com.xxd.rpt3.Entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @Author XuXd
 * @Description: 用户部门
 * @CreateDate: 14:03 2019-09-11
 * @Modified by: *
 */
/**
 * @author Administrator
 *
 */
/**
 * @author Administrator
 *
 */
@Entity
@Table(name = "rpt2_department")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
public class Department {
	@Id
	@GeneratedValue
	int id;
	String name;
	String code;
	@OneToOne
	@JoinColumn(name = "parent_id", referencedColumnName = "id", nullable = true)
	Department parentDepartment;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Department getParentDepartment() {
		return parentDepartment;
	}

	public void setParentDepartment(Department parentDepartment) {
		this.parentDepartment = parentDepartment;
	}

}
